package com.isoft.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft.entity.AirportChange;
import com.isoft.entity.CheckChange;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Value;

import java.util.List;

@Mapper
public interface CheckChangedao extends BaseMapper<CheckChange> {
    @Select("SELECT * FROM AIRPORT.CHECKAPUE")
    public List<CheckChange> getAll();

    //变更审核---审核通过
    @Update("update AIRPORT.CHECKAPUE  SET ISPERMIT=1 WHERE ID = #{ID};")
    public int yetPermitYes(Integer ID);
    @Insert("INSERT INTO AIRPORT.APUE(CODE,FRCD,APAT,CNNM,ENNM,AISO,APSN,ISPERMIT)\n" +
            "    SELECT CODE,FRCD,APAT,CNNM,ENNM,AISO,APSN,ISPERMIT from AIRPORT.CHECKAPUE where ID=#{ID};")
    public void addcheck(Integer id);
    //变更审核---审核未通过--驳回为2
    @Update("update AIRPORT.CHECKAPUE  SET ISPERMIT=2 WHERE ID = #{ID};")
    public int yetPermitNo(Integer ID);
    @Insert("insert into AIRPORT.CHECKAPUE(CODE,FRCD,APAT,CNNM,ENNM,AISO,APSN,ISPERMIT) values (#{code},#{frcd},#{apat},#{cnnm},#{ennm},#{aiso},#{apsn},#{ispermit})")
    public int add(CheckChange checkChange);
}
